//
//  SDShowSkinImageController.m
//  skinDetection
//
//  Created by  liangzhun on 2018/10/31.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "SDShowSkinImageController.h"
#import "SDDetectionViewController.h"
@interface SDShowSkinImageController ()

@end

@implementation SDShowSkinImageController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.skinView.layer.masksToBounds = YES;
    self.skinView.layer.cornerRadius = 5.0;
    self.skinTitle.text = self.dic[@"title"];

    [self.skinImage sd_setImageWithURL:[NSURL URLWithString:self.dic[@"image"]]];
    
    self.potView.layer.cornerRadius = self.potView2.layer.cornerRadius =  2.5f;
    
    self.potView.layer.masksToBounds = self.potView2.layer.masksToBounds = YES;
    
    [self presentView];
    
    
}
- (void)beginDetection
{
    SDDetectionViewController *vc = [SDMethodTool getViewControlWithIdentifier:@"SDDetectionViewController"];
    [self.navigationController pushViewController:vc animated:YES];
    [self dismissView];
    
}
- (void)presentView
{
    self.skinView.alpha = 0.2;
    [UIView animateWithDuration:0.1 animations:^{
        self.skinView.alpha = 1.0;
    } completion:^(BOOL finished) {
        
    }];
}
- (void)dismissView
{

    [UIView animateWithDuration:0.2 animations:^{
        self.skinView.alpha = 0.1;
    } completion:^(BOOL finished) {
        [self.view removeFromSuperview];
        [self removeFromParentViewController];
    }];
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self dismissView];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
